import React from 'react';

import * as icons from '@ant-design/icons';

interface IconProps {
    name: string;
}

function Icon(props: IconProps) {
    let keys: string[] = Object.keys(icons);
    let vals: any = Object.values(icons);
    let iconName: string = props.name;
    if (keys.includes(iconName)) {
        let index = keys.indexOf(iconName);
        let IconEle = vals[index];
        return <IconEle></IconEle>;
    }
    return <div></div>;
}

export default Icon;
